<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <style>
        body {
            margin: 0 auto;
            padding: 0px;
        }
        
        .main {
            width: 100%;
            height: 100%;
            background-color: blueviolet;
        }
        
        .center {
            width: 300px;
            height: 300px;
            background-color: greenyellow;
            border-radius: 150px;
            margin: 0 auto;
            position: absolute;
            z-index: 900;
        }
        
        .clearfix:before,
        .clearfix:after {
            content: "";
            display: table;
        }
        
        .clearfix:after {
            clear: both;
        }
        
        .clearfix {
            *zoom: 1;
        }
        
        .main .area {
            background: orangered;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 888;
            width: 50%;
            height: 50%;
        }
        
        .main .two {
            background-color: green;
            top: '0px';
            left: 50%
        }
        
        .main .three {
            background-color: royalblue;
            top: 50%;
            left: '0px'
        }
        
        .main .four {
            background-color: yellow;
            top: 50%;
            left: '50%'
        }
    </style>

</head>

<body>


    <div class="main clearfix">

        <div class="center clearfix">

        </div>


        <div class="area one"></div>
        <div class="area two"></div>
        <div class="area three"></div>
        <div class="area four"></div>

    </div>

    <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>

    <script>
        $(function() {

            //监听窗口事件 开始
            $(window).bind("load resize", function() {

                var outerWidth = $(window).width();
                var outerHeight = $(window).height();


                $(".main").css({
                    height: outerHeight + 'px'
                });

                $(".center").css({
                    'top': outerHeight / 2 - 150 + 'px',
                    'left': outerWidth / 2 - 150 + 'px'
                });


            });


        });
    </script>

</body>

</html>